﻿<%@ Page Language="C#" AutoEventWireup="true" EnableEventValidation="false" MasterPageFile="~/MasterPage.master"
    Inherits="Customer_Product_List_Item" CodeFile="Customer_Product_List_Item.aspx.cs" %>
    <%@ Register Src="~/UserControl/GridPager.ascx" TagName="GridPager"  TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table id="wsd_inputtable">
                <tr>
                    <td width="100%" class="tabletitle" colspan="6">
                        <asp:Literal ID="Literal3" runat="server" Text="<%$resources:language,lbl_Query_Condition %>"></asp:Literal>
                    </td>
                </tr>
                <tr>
                    <td class="tablefield">
                        <asp:Literal ID="Literal4" runat="server" Text="<%$resources:language,lbl_Manufacturer %>"></asp:Literal>
                    </td>
                    <td nowrap="nowrap">
                        <asp:DropDownList runat="server" ID="ddlManu" Width="130" AutoPostBack="true" OnSelectedIndexChanged="ddlManu_SelectedIndexChanged">
                        </asp:DropDownList>
                    </td>
                    <td class="tablefield">
                        <asp:Literal ID="Literal5" runat="server" Text="<%$resources:language,lbl_Category %>"></asp:Literal>
                    </td>
                    <td nowrap="nowrap">
                        <asp:DropDownList runat="server" ID="ddlCategroy" AutoPostBack="true" Width="130"
                            OnSelectedIndexChanged="ddlCategroy_SelectedIndexChanged">
                        </asp:DropDownList>
                    </td>
                    <td class="tablefield">
                        <asp:Literal ID="Literal6" runat="server" Text="<%$resources:language,lbl_Brand %>"></asp:Literal>
                    </td>
                    <td nowrap="nowrap">
                        <asp:DropDownList runat="server" ID="ddlBrand" Width="130">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td class="tablefield">
                        <asp:Literal ID="Literal41" runat="server" 
                            Text="<%$ resources:language, lbl_Package%>"></asp:Literal>
                    </td>
                    <td nowrap="nowrap">
                        <asp:DropDownList ID="ddlForm" runat="server" Width="130">
                        </asp:DropDownList>
                    </td>
                    <td class="tablefield">
                        <asp:Literal ID="Literal7" runat="server" 
                            Text="<%$resources:language,lbl_DistributionType %>"></asp:Literal>
                    </td>
                    <td nowrap="nowrap">
                        <asp:DropDownList ID="ddlSelected" runat="server" Width="130">
                            <asp:ListItem Text="<%$resources:language,ddl_All %>" Value="0"></asp:ListItem>
                            <asp:ListItem Text="<%$resources:language,ddl_Dispatched %>" Value="1"></asp:ListItem>
                            <asp:ListItem Text="<%$resources:language,ddl_NoDispatch %>" Value="2"></asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td nowrap="nowrap">
                        &nbsp;</td>
                    <td nowrap="nowrap">
                        &nbsp;</td>
                </tr>
        
    <tr>
        <td colspan="3">
            <asp:ValidationSummary runat="server" ID="vs" />
        </td>
        <td class="buttonarea" colspan="3">
            <asp:Button ID="btnQuery" runat="server" class="wsd_button2" Text="<%$resources:language,btn_Query %>"
                CausesValidation="false" OnClick="btnQuery_Click" />
        </td>
    </tr>
    </table>
    <br />
     
    <table id="wsd_listtable" width="100%">
        <tr>
            <td style="width: 100%">
                <asp:GridView BorderWidth="0" Width="100%" ID="GridView1" runat="server" DataKeyNames="ID" AutoGenerateColumns="false"
                    OnRowDataBound="Grid_RowDataBound" EmptyDataText="<%$resources:language,lbl_Empty %>"
                    EmptyDataRowStyle-Font-Bold="true" EmptyDataRowStyle-HorizontalAlign="Center"
                    EnableEmptyContentRender="true" AllowPaging="True" PageSize="50" OnPageIndexChanging="GridView1_PageIndexChanging1">
                    <HeaderStyle CssClass="titlist" />
                    <EmptyDataRowStyle HorizontalAlign="Center" Font-Bold="True"></EmptyDataRowStyle>
                    <Columns>
                        <asp:TemplateField Visible="false" HeaderText="系统ID">
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblItemID" Text='<%# Eval("ItemID") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                         <asp:TemplateField ItemStyle-HorizontalAlign="center" HeaderStyle-HorizontalAlign="center">
                                <ItemTemplate>
                                    <image  src='<%# "../../SMALLIMAGE.aspx?H=80&W=80&ID=" + Eval("PHOTO_ID").ToString()  %>' ></image>
                                     </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                            </asp:TemplateField>
                        <asp:BoundField HeaderText="<%$resources:language,lbl_ProductCode %>" DataField="ProductCode" />
                        <asp:BoundField DataField="FORMNAME" HeaderText="系列" />
                        <asp:BoundField HeaderText="<%$resources:language,lbl_ProductName %>" DataField="ProductName" />
                        <asp:BoundField DataField="ShortProductName" HeaderText="<%$resources:language,lbl_ProductShortName %>"
                            Visible="false" />
                        <asp:BoundField DataField="CategoryName" HeaderText="<%$resources:language,lbl_Category %>" />
                        <asp:BoundField DataField="BrandName" HeaderText="<%$resources:language,lbl_Brand %>" />
                        <asp:BoundField DataField="ManuName" HeaderText="<%$resources:language,lbl_Manufactory %>" />
                        <%--<asp:BoundField DataField="WEIGHT" HeaderText="<%$resources:language,lbl_CaseWeight %>"
                                DataFormatString="{0:N2}" />
                            <asp:BoundField DataField="VOLUME" HeaderText="<%$resources:language,lbl_lblVolume %>"
                                DataFormatString="{0:N2}" />--%>
                        <asp:BoundField DataField="DENOMINATOR" HeaderText="箱/件" />
                        <asp:TemplateField HeaderText="支/价" ItemStyle-Width="100">
                            <ItemTemplate>
                                <asp:TextBox ID="txtPiecePrice" ControlStyle-Width="60" MaxLength="10" runat="server"
                                    Text='<%# string.Format("{0:f2}",Convert.ToDecimal(Eval("PIECE_PRICE"))) %>'>
                                </asp:TextBox>
                                <asp:RegularExpressionValidator ID="revPiecePrice" runat="server" Text="*" ErrorMessage="<%$resources:language,lbl_Format %>"
                                    ValidationExpression="^(\d{1,3}(,\d\d\d)*(\.\d+)?|\d+(\.\d+)?)$" ControlToValidate="txtPiecePrice"></asp:RegularExpressionValidator>
                            </ItemTemplate>
                            <ItemStyle Width="100px"></ItemStyle>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="箱/价" ItemStyle-Width="100">
                            <ItemTemplate>
                                <asp:TextBox  ID="txtCasePrice" ControlStyle-Width="60" MaxLength="10" runat="server"
                                    Text='<%# Eval("CASE_PRICE") != DBNull.Value ? string.Format("{0:f2}",Convert.ToDecimal(Eval("CASE_PRICE"))) : "0" %>'>
                                </asp:TextBox>
                                <asp:RegularExpressionValidator ID="revCasePrice" runat="server" Text="*" ErrorMessage="<%$resources:language,lbl_Format %>"
                                    ValidationExpression="^(\d{1,3}(,\d\d\d)*(\.\d+)?|\d+(\.\d+)?)$" ControlToValidate="txtCasePrice"></asp:RegularExpressionValidator>
                            </ItemTemplate>
                            <ItemStyle Width="100px"></ItemStyle>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="特点" ItemStyle-Width="100">
                            <ItemTemplate>
                                <asp:DropDownList ID="ddl_flag" runat="server">
                                <asp:ListItem Text="不选择" value="0"></asp:ListItem>
                                 <asp:ListItem Text="必售" Value="1"></asp:ListItem>
                                  <asp:ListItem Text="重点关注" Value="2"></asp:ListItem>
                                   <asp:ListItem Text="新品" Value="3"></asp:ListItem>
                                </asp:DropDownList>
                            </ItemTemplate>
                            <ItemStyle Width="100px"></ItemStyle>
                        </asp:TemplateField>
                        <%--<asp:TemplateField HeaderText="<%$resources:language,lbl_TPRDiscount %>" ItemStyle-Width="100">
                                <ItemTemplate>
                                    <asp:TextBox ID="txtTprDiscount" ControlStyle-Width="60" MaxLength="3" runat="server"
                                        Text='<%# Eval("TPR_DISCOUNT") %>'>
                                    </asp:TextBox>
                                    <asp:RegularExpressionValidator ID="revTprDiscount" runat="server" Text="*" ErrorMessage="<%$resources:language,lbl_Format %>"
                                        ValidationExpression="^(\d{1,3}(,\d\d\d)*(\.\d+)?|\d+(\.\d+)?)$" ControlToValidate="txtTprDiscount"></asp:RegularExpressionValidator>
                                </ItemTemplate>
                                <ItemStyle Width="100px"></ItemStyle>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="<%$resources:language,lbl_StartDate %>">
                                <ItemTemplate>
                                    <asp:TextBox ID="TxtStartDate" Width="80" runat="server" Text='<%# Eval("TPR_START_datetime") %>'
                                        CssClass="Wdate" onfocus="WdatePicker()"></asp:TextBox>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="<%$resources:language,lbl_EndDate %>">
                                <ItemTemplate>
                                    <asp:TextBox ID="TxtEndDate" runat="server" Width="80" Text='<%# Eval("TPR_START_datetime") %>'
                                        CssClass="Wdate" onfocus="WdatePicker()"></asp:TextBox>
                                </ItemTemplate>
                            </asp:TemplateField>--%>
                        <asp:TemplateField HeaderText="全选">
                            <HeaderTemplate>
                                <asp:CheckBox runat=server id="chkAll" AutoPostBack=true  OnCheckedChanged ="SelectALL" />
                                <asp:Literal ID="Literal10" runat="server" Text="<%$resources:language,lbl_Include %>"></asp:Literal>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:CheckBox ID="cbxSelected" runat="server" Checked='<%# Eval("Selected") %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <RowStyle CssClass="evenline" />
                    <AlternatingRowStyle CssClass="oddline" />
                    <PagerSettings Visible="false" />
                </asp:GridView>
                <uc1:GridPager ID="GridPager1" runat="server" Visible="false"  />
            </td>
        </tr>
    </table>
    <br />
    <table id="wsd_inputtable">
        <tr>
            <td width="100%" class="tabletitle">
                <asp:Literal ID="Literal40" runat="server" Text="<%$resources:language,lbl_Operation_Area %>"></asp:Literal>
            </td>
        </tr>
        <tr>
            <td class="buttonarea">
                <asp:Button ID="btnSubmiet" runat="server" class="wsd_button2" Text="<%$resources:language,btn_Save %>"
                    OnClick="btnSubmit_Click" />&nbsp;&nbsp;
                <input id="Button2" class="wsd_button2" runat="server" onclick="location.href='Customer_Product_List.aspx'"
                    type="button" value="<%$resources:language,btn_Cancel %>" />
            </td>
        </tr>
    </table>
    </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="ddlManu" EventName="SelectedIndexChanged" />
            <asp:AsyncPostBackTrigger ControlID="ddlCategroy" EventName="SelectedIndexChanged" />
            <asp:AsyncPostBackTrigger ControlID="ddlBrand" EventName="SelectedIndexChanged" />
            <asp:AsyncPostBackTrigger ControlID="ddlSelected" EventName="SelectedIndexChanged" />
             <asp:AsyncPostBackTrigger ControlID="btnQuery" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="btnSubmiet" EventName="Click" />
                                <asp:AsyncPostBackTrigger ControlID="GridView1" EventName="PageIndexChanging" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>
